<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<%response.setHeader("Pragma","No-cache");
	response.setHeader("Cache-Control","no-cache");
	response.setDateHeader("Expires", 0);
	response.flushBuffer();%>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="icon" href="https://static.jianshukeji.com/highcharts/images/favicon.ico">
<style type="text/css">
	#container {
		height: 90vh;
		margin: 0 auto;
	}
</style>
<script src="https://img.hcharts.cn/highcharts/highcharts.js"></script>
<script src="https://img.hcharts.cn/highcharts/modules/exporting.js"></script>
<script src="https://img.hcharts.cn/highcharts-plugins/highcharts-zh_CN.js"></script>
<script src="https://img.hcharts.cn/highcharts/themes/sand-signika.js"></script>
<script type="text/javascript" src="${ctxStatic}/ajz/js/jquery.min.js"></script>
</head>
<body>
<div id="container" style="min-width:400px;height:550px"></div>
<script>

    $(document).ready(function() {
        var msg = 'species';
        $.ajax({
            url: "/a/ajz/ajzBaseinfo/findCheckDetial",
            type: "POST",
            data: "msg="+msg,
            dataType: "json",
            async: true,
            success: function (map) {
                var aqsc_num =  parseInt(map.aqsc_num);
                var cyfw_num = parseInt(map.cyfw_num);
                var wzy_num = parseInt(map.wzy_num);
                var zxxx_num = parseInt(map.zxxx_num);
                var dmxf_num = parseInt(map.dmxf_num);

                var aqscCheckOk = parseInt(map.aqscCheckOk);
                var dmxfCheckOk = parseInt(map.dmxfCheckOk);
                var cyfwCheckOk = parseInt(map.cyfwCheckOk);
                var wzyCheckOk = parseInt(map.wzyCheckOk);
                var xfzCheckOk = parseInt(map.xfzCheckOk);

                var aqsc_uncheck_num =  parseInt(map.aqsc_uncheck_num);
                var cyfw_uncheck_num = parseInt(map.cyfw_uncheck_num);
                var wzy_uncheck_num = parseInt(map.wzy_uncheck_num);
                var zxxx_uncheck_num = parseInt(map.zxxx_uncheck_num);
                var dmxf_uncheck_num = parseInt(map.dmxf_uncheck_num);

                var aqsc_check_num = aqsc_num - aqsc_uncheck_num;
                var cyfw_check_num = cyfw_num - cyfw_uncheck_num;
                var wzy_check_num = wzy_num - wzy_uncheck_num;
                var zxxx_check_num = zxxx_num - zxxx_uncheck_num;
                var dmxf_check_num = dmxf_num - dmxf_uncheck_num;

                getDate(aqsc_uncheck_num,aqsc_check_num,dmxf_uncheck_num,dmxf_check_num,cyfw_uncheck_num,cyfw_check_num,wzy_uncheck_num,wzy_check_num,
                    zxxx_uncheck_num,zxxx_check_num,aqscCheckOk,dmxfCheckOk,cyfwCheckOk,wzyCheckOk,xfzCheckOk);
            }
        });
    });



	function getDate(a,b,c,d,e,f,g,h,i,j,h,i,j,z,k) {
        var chart = Highcharts.chart('container', {
            chart: {
                type: 'bar'
            },
            title: {
                text: '排查情况统计'
            },
            xAxis: {
                categories: ['安全生产', '店面消防', '餐饮服务', '无证园', '小饭桌']
            },
            yAxis: {
                min: 0,
                title: {
                    text: '企业总量'
                }
            },
            legend: {
                /* 图例显示顺序反转
                 * 这是因为堆叠的顺序默认是反转的，可以设置
                 * yAxis.reversedStacks = false 来达到类似的效果
                 */
                reversed: true
            },
            tooltip: {
                formatter: function () {
                    return '<b>' + this.x + '</b><br/>' +
                        this.series.name + ': ' + this.y + '<br/>' +
                        '总量: ' + this.point.stackTotal;
                }
            },
            plotOptions: {
                series: {
                    stacking: 'normal'
                }
            },
            series: [{
                name: '未排查',
                data: [a, c, e, g, i]
            }, {
                name: '已排查，未整改',
                data: [b-h, d-i, f-j, h-z, j-k]
            }, {
                name: '已整改',
                data: [h, i, j, z, k]
            }]
        });
    }
</script>
</body>
</html>